<?php defined("MAIN_DIR") or die("No direct access"); ?>
<div id="spisok_bankov">
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td align="left" valign="middle">
				<div id='bank_list_link'>
					<span id='bank_header'>Список банков <?php echo $current_city['city_name_rod'];?></span><img id="bank_header_img" src="/files/images/arr_down.png" width="13" height="13" align="middle" border="0" />
					<div id="bank_list">
						<span>Список банков <?php echo $current_city['city_name_rod']; ?></span><?php
						$bank_list_res = mysql_query("select * from `bank` where `city_id` = '$_SESSION[city]' order by `name` limit 21");
						$bank_list_count = mysql_num_rows($bank_list_res);
						if ($bank_list_count > 0)
						{
							echo "<table id='bank_list_table' cellspacing='4' cellspacing='0' border='0' valign='top'>";
							for($i=0; $i<$bank_list_count;)
							{
								$td = 0;
								echo "<tr>";
								while ($td < 3 && $i < $bank_list_count)
								{
									$td++;
									$i++;
									$bank_list_row = mysql_fetch_array($bank_list_res);
									echo "<td width='200'>";
									echo "<a href='/$c_name/banks/{$bank_list_row['link']}.html'>".$bank_list_row['name']."</a>";
									echo "</td>";
								}
								while($td < 3)
								{
									echo "<td></td>";
									$td++;
								}
								echo "</tr>";
							}
							echo "</table>";
							echo "<div style='font-size:10pt;text-align:right;width:100%'><a href='/$c_name/banks/'>весь список</a></div>";
						}
						else
							echo "<div style='width:100%;text-align:center;'><h4 class='gag'>Нет банков</h4></div>";
					?></div>
				</div>
			</td>
		</tr>
	</table>
</div>